package com.qingke.oo.test;

public class Person_Clone implements Cloneable{
	String name;
	int age;
	
	public Person_Clone(String name,int age){
		this.name = name;
		this.age = age;
	}
	
	public String toString(){
		return "Person[name= "+name+",age= "+age+"]";
	}
	
	public static void main(String [] args){
		Person_Clone p = new Person_Clone("Mike",23);
/*		String li = new String("lkj");
		System.out.println(li);
		String op = "lkj";
		System.out.println(op==li);*/
		try {
			Person_Clone p2 = (Person_Clone)p.clone();
			p2.name = "Ben";
			System.out.println(p2);
			System.out.println(p);
		} catch (CloneNotSupportedException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
	}
}
